//
//  RecommenderCell.m
//  EnvironmentalProtection
//
//  Created by HCreater on 2018/11/7.
//  Copyright © 2018年 HCreater. All rights reserved.
//

#import "RecommenderCell.h"

@interface RecommenderCell ()

/// viewModle
@property (nonatomic, readwrite, strong) RecommenderCellModel *viewModel;

/// IBOutlet
@property (weak, nonatomic) IBOutlet UIImageView* avatarView;
@property (weak, nonatomic) IBOutlet UILabel* nameLabel;

@end

@implementation RecommenderCell

- (void)awakeFromNib
{
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

#pragma mark - bind data
- (void)bindViewModel:(RecommenderCellModel *)viewModel
{
    self.viewModel = viewModel;
    
    @weakify(self);
    
    [[self rac_signalForSelector:@selector(layoutSubviews)] subscribeNext:^(id x)
    {
        @strongify(self);
        
        self.avatarView.layer.cornerRadius = self.avatarView.frame.size.height/2.0f;
        self.avatarView.layer.masksToBounds = YES;
    }];
}

@end
